package com.learn.algorithm.list;

public class ListNode {
    public ListNode(int val) {
        this.val = val;
    }

    public int val;
    public ListNode next;

    public void print() {
        ListNode head = this;
        while (head != null) {
            System.out.println(head.val + " ");
            head = head.next;
        }
    }
}
